package com.zerox.singleton.demo03;

public class YaFactory {
    private static YaFactory yaFactory;

    private YaFactory(){

    }

    public static YaFactory getInstance(){
        if (yaFactory ==null){
            yaFactory = Helper.FACTORY;
        }
        return yaFactory;
    }
    //内部类
    static class Helper{
       final static YaFactory FACTORY = new YaFactory();
    }
}
